package com.rc.object;

import com.rc.activity.dao.tbl_TripItems;
import com.rc.util.Util;

public class TripItemsObj {

	public static String[] keys = { "TripItemID", "TripID", "IsClaimed",
			"IsApproved", "Claimed", "Approved" };

	public static String TRIP_ITEM_ID = keys[0];
	public static String TRIP_ID = keys[1];
	public static String IS_CLAIMED = keys[2];
	public static String IS_APPROVED = keys[3];
	public static String CLAIMED = keys[4];
	public static String APPROVED = keys[5];

	public static tbl_TripItems getObjTripByBaseObject(BaseObject baseObj) {
		if (baseObj == null) {
			return null;
		}
		float claimed = 0;
		if (baseObj.getParam(CLAIMED) != null
				&& !"null".equals(baseObj.getParam(CLAIMED))) {
			claimed = Util.convertFloat(baseObj.getParam(CLAIMED));
		}
		float approved = 0;
		if (baseObj.getParam(APPROVED) != null
				&& !"null".equals(baseObj.getParam(APPROVED))) {
			approved = Util.convertFloat(baseObj.getParam(APPROVED));
		}
		return new tbl_TripItems(baseObj.getParamLong(TRIP_ITEM_ID),
				baseObj.getParam(TRIP_ID), baseObj.getParamInt(IS_CLAIMED),
				baseObj.getParamInt(IS_APPROVED), claimed, approved, "", "", "");
	}
}
